1. Field of the Invention
The present invention generally relates to the field of computer vision, and specifically, a method and an apparatus for separating a foreground image from an image.
2. Description of the Related Art
The technology of foreground image separation, i.e., the technology of image cut-out means separating a foreground object from an image or a video frame and estimating the transparency, i.e., α value (α masking) of each pixel in a region covered by the foreground object.
Such technology is widely applied in image or video editing applications. A user can separate foreground by this technology and combine the foreground with another background. As an example, in virtual photographing, the foreground such as a person can be combined with the virtual background to obtain an immersive experience, and for example, a conference participant can be separated from the original background in a video conference and be combined with another background.
In the current image cut-out process, a three-color image is usually used. From the viewpoint of image composition, an image I(x,y) may be modeled as a linear combination of a foreground image F(x,y), a background image B(x,y) and a value α(x,y), namely the equation I=αF+(1−α)B, where α(x,y) ε[0,1]. In order to solve this problem, an input image is usually divided into three regions, i.e., foreground region, background region and unknown region, and it is also referred to as a three-color image. The forming of the three-color image is the basis of a subsequent separation process, and a more accurate three-color image helps to separate a foreground object from an image or a video more accurately.
In the current methods for forming a three-color image, one method is to specify a three-color image in an image by a user in a user-interaction way, and for example, to draw some line segments in an image to specify which part is the foreground and which part is the background in the image. In this method, it is necessary for the user to generate the three-color image manually, thus it takes user's labor and the generated three-color image is not accurate enough. Another method is to introduce depth information to help to automatically generate a three-color image. In this method, user interaction is not required, however an object in the background which is close to a foreground object may still be included in a foreground region.
Furthermore, when calculating an α value based on a three-color image after the three-color image is obtained, the calculation is usually performed using only color information of the image. However, when the color of a foreground object in the image is close to the color of a background part, it is difficult to distinguish these two relying on only the color information, particularly, in a boundary region; thus it is difficult to obtain an accurate separation result.